home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
-
- global string $dynPaintSceneToolsToolbox = "";
- global string $dynPaintCanvasToolsToolbox = "";
- global string $dynPaintTubeTools = "";
- global string $dynPaintLeafTools = "";
- global string $dynPaintFlowerTools = "";
- global string $dynPaintBudTools = "";
- global string $dynPaintToolbar;
-
-
- global proc doCanvasClear(string $editor)
-
- //
- // This procedure is executed when the user clicks on the clear icon.
- // It prompts the user for confirmation first and then clears the canvas
- // or deletes strokes in the scene.
- //
-
- {
- global string $gDynPaintEditorName;
-
- // if we're in canvas mode .. clear the canvas
-
- if( `dynPaintEditor -q -canvasMode $gDynPaintEditorName` ) {
-
- // if autosave is on warn the user about data loss
-
- // if ( `dynPaintEditor -q -autoSave $gDynPaintEditorName`) {
- //
- // string $confirmClear = `confirmDialog
- // -m "Clear the Canvas? \n \n Auto Save is on, you will lose your work. \n"
- // -button "Clear"
- // -button "Cancel"
- // -defaultButton "Cancel"
- // -cancelButton "Cancel"`;
- //
- // if ($confirmClear == "Clear") {
- //
-
-
- // if ( `dynPaintEditor -q -autoSave $gDynPaintEditorName`) {
- // // turn off autosave
- // toggleAutoSave ($editor);
- // }
-
- // clear the canvas
- float $cc[] = `optionVar -q dynPaintPanelClearColour`;
- dynPaintEditor -e -cl $cc[0] $cc[1] $cc[2] $editor;
- // }
- //
- // }
-
- // // autosave is off .. just clear the canvas
- //
- // else {
- // float $cc[] = `optionVar -q dynPaintPanelClearColour`;
- // dynPaintEditor -e -cl $cc[0] $cc[1] $cc[2] $editor;
- // }
-
- } else { // we're in paint scene mode .. delete strokes
-
- deleteAllStrokes();
- }
- }
-
-
- global proc setDynPaintOnlyToolbox( int $state )
- {
- // global string $dynPaintSceneToolsToolbox;
- //
- // if( size( $dynPaintSceneToolsToolbox ) > 0 )
- // {
- // setParent $dynPaintSceneToolsToolbox;
- // symbolCheckBox -e -v $state "activeOnlyCheckBox";
- // }
- }
-
- global proc setDynPaintAutoSaveToolbox( int $state )
- {
- global string $dynPaintSceneToolsToolbox;
-
- if( size( $dynPaintSceneToolsToolbox ) > 0 )
- {
- setParent $dynPaintSceneToolsToolbox;
- symbolCheckBox -e -v $state "autoSaveCheckBox";
- }
- }
-
- global proc setShowLeafTools()
- {
- global string $dynPaintLeafTools;
- string $defBrush = getDefaultBrush();
- if( size( $dynPaintLeafTools ) > 0 )
- {
- int $leaves = getAttr( $defBrush + ".leaves" );
- int $tubes = getAttr( $defBrush + ".tubes" );
- $leaves = ($leaves && $tubes);
-
- setParent $dynPaintLeafTools;
- attrColorSliderGrp -e -manage $leaves brushLC1;
- attrColorSliderGrp -e -manage $leaves brushLC2;
- }
- }
-
- global proc setShowFlowerTools()
- {
- global string $dynPaintFlowerTools;
-
- string $defBrush = getDefaultBrush();
- if( size( $dynPaintFlowerTools ) > 0 )
- {
- int $flowers = getAttr( $defBrush + ".flowers" );
- int $tubes = getAttr( $defBrush + ".tubes" );
- $flowers = ($flowers && $tubes );
-
- setParent $dynPaintFlowerTools;
- attrColorSliderGrp -e -manage $flowers brushPC1;
- attrColorSliderGrp -e -manage $flowers brushPC2;
- }
- }
-
- global proc setShowBudTools()
- {
- global string $dynPaintBudTools;
-
- string $defBrush = getDefaultBrush();
- if( size( $dynPaintBudTools ) > 0 )
- {
- int $buds = getAttr( $defBrush + ".buds" );
- int $tubes = getAttr( $defBrush + ".tubes" );
- $buds = ($buds && $tubes);
-
- setParent $dynPaintBudTools;
- attrColorSliderGrp -e -manage $buds brushBC;
- }
- }
-
- global proc setShowTubeTools()
- {
- global string $dynPaintTubeTools;
-
- string $defBrush = getDefaultBrush();
- if( size( $dynPaintTubeTools ) > 0 )
- {
- int $tubes = getAttr( $defBrush + ".tubes" );
-
- setParent $dynPaintTubeTools;
-
- attrFieldSliderGrp -e -manage $tubes brushTS;
- attrColorSliderGrp -e -manage $tubes brushC2;
- attrColorSliderGrp -e -manage $tubes brushT2;
- setShowLeafTools();
- // formLayout -e -manage $tubes "leafTools";
- setShowFlowerTools();
- // formLayout -e -manage $tubes "flowerTools";
- setShowBudTools();
- // formLayout -e -manage $tubes "budTools";
- }
- }
-
- global proc setDynPaintModeToolbox( int $mode )
- {
- // global string $dynPaintSceneToolsToolbox;
- //
- // if( size( $dynPaintSceneToolsToolbox ) > 0 )
- // {
- //
- // setParent $dynPaintSceneToolsToolbox;
- //
- // switch( $mode )
- // {
- // case 0:
- // symbolCheckBox -e -v 1 "refreshOffCheckBox";
- // symbolCheckBox -e -v 0 "refreshWireCheckBox";
- // symbolCheckBox -e -v 0 "refreshRenderedCheckBox";
- // break;
- // case 1:
- // symbolCheckBox -e -v 0 "refreshOffCheckBox";
- // symbolCheckBox -e -v 1 "refreshWireCheckBox";
- // symbolCheckBox -e -v 0 "refreshRenderedCheckBox";
- // break;
- // case 2:
- // symbolCheckBox -e -v 0 "refreshOffCheckBox";
- // symbolCheckBox -e -v 0 "refreshWireCheckBox";
- // symbolCheckBox -e -v 1 "refreshRenderedCheckBox";
- // break;
- // }
- // }
- }
-
-
- global proc showDynPaintSceneTools( int $state )
- {
- global string $dynPaintSceneToolsToolbox;
- global string $dynPaintCanvasToolsToolbox;
- global string $dynPaintToolbar;
-
- if( size( $dynPaintSceneToolsToolbox ) > 0 )
- {
- setParent $dynPaintSceneToolsToolbox;
- symbolButton -e -manage $state "renderButton";
- // symbolCheckBox -e -manage $state "refreshOffCheckBox";
- // symbolCheckBox -e -manage $state "refreshWireCheckBox";
- // symbolCheckBox -e -manage $state "refreshRenderedCheckBox";
- // symbolCheckBox -e -manage $state "activeOnlyCheckBox";
-
- setParent $dynPaintCanvasToolsToolbox;
- symbolCheckBox -e -manage (!$state) "autoSaveCheckBox";
- symbolCheckBox -e -manage (!$state) "wrapHCheckBox";
- symbolCheckBox -e -manage (!$state) "wrapVCheckBox";
- }
- }
-
- global proc dynPaintRenderAll( string $editor )
- {
- int $strokeRedraw = `dynPaintEditor -q -refreshMode $editor`;
- dynPaintEditor -edit -refreshMode 2 $editor;
- dynPaintEditor -edit -pa 0 $editor;
- dynPaintEditor -edit -refreshMode $strokeRedraw $editor;
- }
-
- global proc dynPaintToolbarConnectControls( string $tubes,
- string $color1,
- string $transparency1,
- string $tubesPerStep,
- string $color2,
- string $transparency2,
- string $leafColor1,
- string $leafColor2,
- string $petalColor1,
- string $petalColor2,
- string $budColor )
- {
- string $defBrush = getDefaultBrush();
- connectControl $tubes ( $defBrush + ".tubes" );
-
- // C, T color sliders
- //
- attrColorSliderGrp -e -at ( $defBrush + ".color1" ) $color1;
- attrColorSliderGrp -e -at ( $defBrush + ".transparency1" ) $transparency1;
-
- // TS float field
- //
- attrFieldSliderGrp -e -at ( $defBrush + ".tubesPerStep" ) $tubesPerStep;
-
- // C2, T2 color sliders
- //
- attrColorSliderGrp -e -at ( $defBrush + ".color2" ) $color2;
- attrColorSliderGrp -e -at ( $defBrush + ".transparency2" ) $transparency2;
-
- // L1, L2 color boxes
- //
- attrColorSliderGrp -e -at ($defBrush+".leafColor1") $leafColor1;
- attrColorSliderGrp -e -at ($defBrush+".leafColor2") $leafColor2;
-
- // P1, P2 color boxes
- //
- attrColorSliderGrp -e -at ($defBrush+".petalColor1") $petalColor1;
- attrColorSliderGrp -e -at ($defBrush+".petalColor2") $petalColor2;
-
- // B color box
- //
- attrColorSliderGrp -e -at ($defBrush+".budColor") $budColor;
-
- // These enable/disable display of some of the above widgets
- // based on settings in the default brush.
- //
- scriptJob -parent $tubes -replacePrevious
- -attributeChange ($defBrush + ".tubes") setShowTubeTools;
- scriptJob -parent $leafColor1 -replacePrevious
- -attributeChange ($defBrush + ".leaves") setShowLeafTools;
- scriptJob -parent $petalColor1 -replacePrevious
- -attributeChange ($defBrush + ".flowers") setShowFlowerTools;
- scriptJob -parent $budColor -replacePrevious
- -attributeChange ($defBrush + ".buds") setShowBudTools;
-
- // The settings in the default brush have changed. Calling this
- // ensures we're displaying the right set of widgets for the
- // default brush.
- //
- setShowTubeTools();
- }
-
- global proc string dynPaintToolbar( string $editor )
- {
- global string $dynPaintSceneToolsToolbox;
- global string $dynPaintCanvasToolsToolbox;
- global string $dynPaintTubeTools;
- global string $dynPaintLeafTools;
- global string $dynPaintFlowerTools;
- global string $dynPaintBudTools;
- global string $dynPaintToolbar;
-
- string $flipTubeButton;
-
- string $toolbar = `formLayout "dptoolbar"`;
- $dynPaintToolbar = $toolbar;
-
- symbolButton
- -image "hsClearView.xpm"
- -width 28 -height 28
- -annotation "Clear Canvas/Delete All Strokes"
- -command ("doCanvasClear(\"" + $editor + "\")")
- canvasClearButton;
-
- symbolButton
- -image "rvAllPlanes.xpm"
- -width 28 -height 28
- -annotation "Display RGB Channels"
- -command
- ("dynPaintEditor "
- + "-edit "
- + "-displayStyle \"color\" "
- + "-scaleRed 1 "
- + "-scaleGreen 1 "
- + "-scaleBlue 1 "
- + $editor )
- allPlanesButton;
-
- symbolButton
- -image "rvMaskPlane.xpm"
- -width 28 -height 28
- -annotation "Display Alpha Channel"
- -command
- ("dynPaintEditor "
- + "-edit "
- + "-displayStyle \"mask\" "
- + $editor )
- maskButton;
-
- symbolButton
- -image "rvRealSize.xpm"
- -width 28 -height 28
- -annotation "Display Paint Effects View at actual (pixel) size"
- -command
- ("dynPaintEditor "
- + "-edit "
- + "-zoom 1 "
- + $editor)
- realSizeButton;
-
- symbolButton
- -image "savePaintSnapshot.xpm"
- -width 28 -height 28
- -annotation
- "Save a snapshot of what is currently displayed to a file."
- -command ("dynPaintSaveDialog(\"" + $editor + "\")")
- snapShotButton;
-
- string $canvasTools = `formLayout "canvasTools"`;
- $dynPaintCanvasToolsToolbox = $canvasTools;
- int $autoSave = `dynPaintEditor -q -autoSave $editor`;
- symbolCheckBox
- -v $autoSave
- -image "paintAutoSave.xpm"
- -width 28 -height 28
- -annotation "Save canvas after every stroke, updating textures."
- -onc ("dynPaintSave " + $editor + ";toggleAutoSave " + $editor)
- -ofc ("toggleAutoSave " + $editor)
- autoSaveCheckBox;
-
- symbolCheckBox
- -image "paintWrapH.xpm"
- -width 28 -height 28
- -annotation "Wrap Canvas Horizontally"
- wrapHCheckBox;
- //
- // Attach this check box to the Stroke Globals Horizontal Wrap
- // attribute. This will keep the attribute in sync with the
- // control and vise-versa. Bug #115364 - bwk 14jul99.
- //
- connectControl wrapHCheckBox strokeGlobals.wrapH;
-
- symbolCheckBox
- -image "paintWrapV.xpm"
- -width 28 -height 28
- -annotation "Wrap Canvas Vertically"
- wrapVCheckBox;
- //
- // Attach this check box to the Stroke Globals Vertical Wrap
- // attribute. This will keep the attribute in sync with the
- // control and vise-versa. Bug #115364 - bwk 14jul99.
- //
- connectControl wrapVCheckBox strokeGlobals.wrapV;
-
- formLayout
- -edit
-
- -attachForm "autoSaveCheckBox" "left" 1
- -attachNone "autoSaveCheckBox" "right"
- -attachForm "autoSaveCheckBox" "top" 1
- -attachForm "autoSaveCheckBox" "bottom" 1
-
- -attachControl "wrapHCheckBox" "left" 1 "autoSaveCheckBox"
- -attachNone "wrapHCheckBox" "right"
- -attachForm "wrapHCheckBox" "top" 1
- -attachForm "wrapHCheckBox" "bottom" 1
-
- -attachControl "wrapVCheckBox" "left" 1 "wrapHCheckBox"
- -attachNone "wrapVCheckBox" "right"
- -attachForm "wrapVCheckBox" "top" 1
- $canvasTools;
- setParent ..;
-
- string $sceneTools = `formLayout "sceneTools"`;
- $dynPaintSceneToolsToolbox = $sceneTools;
- symbolButton
- -image "redrawPaintEffects.xpm"
- -width 28 -height 28
- -annotation "Redraw Paint Effects View"
- -command
- ("dynPaintRenderAll " + $editor)
- renderButton;
-
- int $activeRef = `dynPaintEditor -q -ao $editor`;
- // symbolCheckBox
- // -v $activeRef
- // -image "refreshSelectedOnly.xpm"
- // -width 28 -height 28
- // -annotation "Refresh only selected strokes."
- // -cc ("toggleActiveOnlyStrokeRefresh " + $editor)
- // activeOnlyCheckBox;
-
- // symbolCheckBox
- // -v false
- // -image "strokeRefreshOff.xpm"
- // -width 28 -height 28
- // -annotation "Stroke Refresh Off"
- // -onc ("setStrokeRefreshMode 0 " + $editor)
- // refreshOffCheckBox;
-
- // symbolCheckBox
- // -v true
- // -image "strokeRefreshWireframe.xpm"
- // -width 28 -height 28
- // -annotation "Wireframe Stroke Refresh"
- // -onc ("setStrokeRefreshMode 1 " + $editor)
- // refreshWireCheckBox;
-
- // symbolCheckBox
- // -v false
- // -image "strokeRefreshRendered.xpm"
- // -width 28 -height 28
- // -annotation "Rendered Stroke Refresh"
- // -onc ("setStrokeRefreshMode 2 " + $editor)
- // refreshRenderedCheckBox;
-
- formLayout
- -edit
- -attachForm "renderButton" "left" 1
- -attachNone "renderButton" "right"
- -attachForm "renderButton" "top" 1
- -attachForm "renderButton" "bottom" 1
-
- // -attachControl "activeOnlyCheckBox" "left" 10 "renderButton"
- // -attachNone "activeOnlyCheckBox" "right"
- // -attachForm "activeOnlyCheckBox" "top" 1
-
- // -attachControl "refreshOffCheckBox" "left" 10 "activeOnlyCheckBox"
- // -attachNone "refreshOffCheckBox" "right"
- // -attachForm "refreshOffCheckBox" "top" 1
-
- // -attachControl "refreshWireCheckBox" "left" 1 "refreshOffCheckBox"
- // -attachNone "refreshWireCheckBox" "right"
- // -attachForm "refreshWireCheckBox" "top" 1
-
- // -attachControl "refreshRenderedCheckBox" "left" 1 "refreshWireCheckBox"
- // -attachNone "refreshRenderedCheckBox" "right"
- // -attachForm "refreshRenderedCheckBox" "top" 1
- $sceneTools;
- setParent ..;
-
- symbolButton
- -image "templateBrushSettingsSmall.xpm"
- -width 28 -height 28
- -annotation "Edit Template Brush"
- -command "brushToolSettings"
- brushEditorButton;
-
- symbolButton
- -image "paintEffectsBrushes.xpm"
- -width 28 - height 28
- -annotation "Get Brush"
- -command "VisorWindow"
- // for future use
- // -command "VisorWindow paintEffects"
- brushesButton;
-
- // Now define all the controls we want to connect to the
- // default brush.
- //
- string $tubeCheckBox = `symbolCheckBox
- -image "createTubes.xpm"
- -width 28 -height 28
- -annotation "Make Tubes"
- -onc ("setAttr (getDefaultBrush() + \".tubes\") 1")
- -ofc ("setAttr (getDefaultBrush() + \".tubes\") 0")
- tubeCheckBox`;
-
- symbolButton
- -image "flipTubeSmall.xpm"
- -width 28 -height 28
- -annotation "Flip the Tube Direction on the Current Brush"
- -command "changeTubeDirection"
- flipTubeButton;
-
-
- string $brushC1 = `attrColorSliderGrp -label "C" -ann "color 1"
- -w 115 -h 28 -sb 0 -cw4 20 30 60 1 brushC1`;
-
- string $brushT1 = `attrColorSliderGrp -label "T" -ann "transparency 1"
- -w 115 -h 28 -sb 0 -cw4 20 30 60 1 brushT1`;
-
- string $tubeTools = `formLayout "tubeTools"`;
- $dynPaintTubeTools = $tubeTools;
-
- string $brushTS = `attrFieldSliderGrp -label "TS"
- -ann "Tubes Per Step" -pre 2
- -h 28 -w 77 -cw4 28 50 60 1 brushTS`;
-
- string $brushC2 = `attrColorSliderGrp -label "C2" -ann "color 2"
- -w 121 -h 28 -sb 0 -cw4 28 30 60 1 brushC2`;
-
- string $brushT2 = `attrColorSliderGrp -label "T2"
- -ann "transparency 2"
- -w 121 -h 28 -sb 0 -cw4 28 30 60 1 brushT2`;
-
- string $leafTools = `formLayout "leafTools"`;
- $dynPaintLeafTools = $leafTools;
-
- string $brushLC1 = `attrColorSliderGrp -label "L1"
- -ann "leaf color 1"
- -w 58 -h 28 -sb 0 -cw4 28 30 60 1 brushLC1`;
-
- string $brushLC2 = `attrColorSliderGrp -label "L2"
- -ann "leaf color 2"
- -w 58 -h 28 -sb 0 -cw4 28 30 60 1 brushLC2`;
-
- formLayout
- -edit
-
- -attachForm $brushLC1 "left" 1
- -attachNone $brushLC1 "right"
- -attachForm $brushLC1 "top" 1
- -attachForm $brushLC1 "bottom" 1
-
- -attachControl $brushLC2 "left" 1 $brushLC1
- -attachNone $brushLC2 "right"
- -attachForm $brushLC2 "top" 1
- -attachForm $brushLC2 "bottom" 1
- $leafTools;
-
-
- setParent..;
-
- string $flowerTools = `formLayout "flowerTools"`;
- $dynPaintFlowerTools = $flowerTools;
-
- string $brushPC1 = `attrColorSliderGrp -label "P1"
- -ann "petal color 1" -w 58 -h 28 -sb 0
- -cw4 28 30 60 1 brushPC1`;
-
- string $brushPC2 = `attrColorSliderGrp -label "P2"
- -ann "petal color 2" -w 58 -h 28 -sb 0
- -cw4 28 30 60 1 brushPC2`;
-
- formLayout
- -edit
- -attachForm $brushPC1 "left" 1
- -attachNone $brushPC1 "right"
- -attachForm $brushPC1 "top" 1
- -attachForm $brushPC1 "bottom" 1
-
- -attachControl $brushPC2 "left" 1 $brushPC1
- -attachNone $brushPC2 "right"
- -attachForm $brushPC2 "top" 1
- -attachForm $brushPC2 "bottom" 1
- $flowerTools;
-
- setParent..;
-
- string $budTools = `formLayout "budTools"`;
- $dynPaintBudTools = $budTools;
-
- string $brushBC = `attrColorSliderGrp -label "B"
- -ann "bud color" -w 55 -h 28 -sb 0
- -cw4 25 30 60 1 brushBC`;
-
- formLayout
- -edit
- -attachForm $brushBC "left" 1
- -attachNone $brushBC "right"
- -attachForm $brushBC "top" 1
- -attachForm $brushBC "bottom" 1
- $budTools;
- setParent..;
-
- formLayout
- -edit
- -attachForm $brushTS "left" 1
- -attachNone $brushTS "right"
- -attachForm $brushTS "top" 1
- -attachForm $brushTS "bottom" 1
-
- -attachControl $brushC2 "left" 7 $brushTS
- -attachNone $brushC2 "right"
- -attachForm $brushC2 "top" 1
- -attachForm $brushC2 "bottom" 1
-
- -attachControl $brushT2 "left" 1 $brushC2
- -attachNone $brushT2 "right"
- -attachForm $brushT2 "top" 1
- -attachForm $brushT2 "bottom" 1
-
- -attachControl $leafTools "left" 1 $brushT2
- -attachNone $leafTools "right"
- -attachForm $leafTools "top" 0
- -attachForm $leafTools "bottom" 0
-
- -attachControl $flowerTools "left" 1 $leafTools
- -attachNone $flowerTools "right"
- -attachForm $flowerTools "top" 0
- -attachForm $flowerTools "bottom" 0
-
- -attachControl $budTools "left" 1 $flowerTools
- -attachNone $budTools "right"
- -attachForm $budTools "top" 0
- -attachForm $budTools "bottom" 0
-
- $tubeTools;
- setParent..;
-
- formLayout
- -edit
- -attachForm "canvasClearButton" "left" 1
- -attachNone "canvasClearButton" "right"
- -attachForm "canvasClearButton" "top" 1
-
- -attachControl "allPlanesButton" "left" 1 "canvasClearButton"
- -attachNone "allPlanesButton" "right"
- -attachForm "allPlanesButton" "top" 1
- -attachForm "allPlanesButton" "bottom" 1
-
- -attachControl "maskButton" "left" 1 "allPlanesButton"
- -attachNone "maskButton" "right"
- -attachForm "maskButton" "top" 1
-
- -attachControl "realSizeButton" "left" 1 "maskButton"
- -attachNone "realSizeButton" "right"
- -attachForm "realSizeButton" "top" 1
-
- -attachControl "snapShotButton" "left" 10 "realSizeButton"
- -attachNone "snapShotButton" "right"
- -attachForm "snapShotButton" "top" 1
-
-
- -attachControl "brushEditorButton" "left" 10 "snapShotButton"
- -attachNone "brushEditorButton" "right"
- -attachForm "brushEditorButton" "top" 1
-
- -attachControl "brushesButton" "left" 1 "brushEditorButton"
- -attachNone "brushesButton" "right"
- -attachForm "brushesButton" "top" 1
-
- -attachControl $canvasTools "left" 10 "brushesButton"
- -attachNone $canvasTools "right"
- -attachForm $canvasTools "top" 0
-
- -attachControl $sceneTools "left" 10 "canvasTools"
- -attachNone $sceneTools "right"
- -attachForm $sceneTools "top" 0
-
- -attachControl $tubeCheckBox "left" 10 $sceneTools
- -attachNone $tubeCheckBox "right"
- -attachForm $tubeCheckBox "top" 1
-
-
- -attachControl "flipTubeButton" "left" 1 $tubeCheckBox
- -attachNone "flipTubeButton" "right"
- -attachForm "flipTubeButton" "top" 1
-
-
- -attachControl $brushC1 "left" 10 "flipTubeButton"
- -attachNone $brushC1 "right"
- -attachForm $brushC1 "top" 1
-
- -attachControl $brushT1 "left" 1 $brushC1
- -attachNone $brushT1 "right"
- -attachForm $brushT1 "top" 1
-
- -attachControl $tubeTools "left" 7 $brushT1
- -attachNone $tubeTools "right"
- -attachForm $tubeTools "top" 0
-
-
- $toolbar;
-
-
- // Here is the list of all the controls that are to be
- // connected to the default brush.
- //
- string $controlsToConnect[] = { $tubeCheckBox,
- $brushC1, $brushT1,
- $brushTS,
- $brushC2, $brushT2,
- $brushLC1, $brushLC2,
- $brushPC1, $brushPC2,
- $brushBC };
-
- // Can't concatenate a $string with a $string[] to create the
- // command we need to give to the script job. This creates
- // one string for the command.
- //
- string $reconnectCmd = "dynPaintToolbarConnectControls ";
- for( $connectThis in $controlsToConnect ) {
- $reconnectCmd = ( $reconnectCmd + $connectThis + " " );
- }
-
- // Now connect up the toolbar controls to the attributes
- // on the default brush they need to listen to.
- //
- eval( $reconnectCmd );
-
- // And since the default brush will be deleted on file->new,
- // the controls listed above will be disabled, since node
- // for which they were watching attributes no longer exists.
- //
- // We have to reconnect the controls to the "new" default
- // brush.
- //
- scriptJob -protected -parent $toolbar -event NewSceneOpened $reconnectCmd;
- scriptJob -protected -parent $toolbar -event SceneOpened $reconnectCmd;
-
- setParent ..;
-
- if( `dynPaintEditor -q -canvasMode $editor` )
- {
- showDynPaintSceneTools( false );
- }
- else
- {
- showDynPaintSceneTools( true );
- }
- setShowTubeTools();
-
- return( $toolbar );
- }
-